package _05Base64的编码与解码;

import java.util.Base64;

public class DemoString {
    public static void main(String[] args) {
        String s = "兄弟们，今晚洗脚吗？";
        //文字编码
        String base = Base64.getEncoder().encodeToString(s.getBytes());
        System.out.println(base);

        //文字解码
        byte[] decode = Base64.getDecoder().decode(base);
        System.out.println(new String(decode));
    }
}
